<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        #d1 {
            width: 1500px;
            height: 100px;
            background-color: red;
            /*设置固定定位*/
            position: fixed;
            top: 0;
        }

        #d2 {
            width: 50px;
            height: 200px;
            background-color: green;
            position: fixed;
            right: 20px;
            bottom: 50px;
        }
    </style>
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
<img src="../mg.png" alt="">
</body>
</html>